#include "atmoslayer.h"
#include <QDebug>
#include <math.h>
#include <QDir>
#include <QDate>
//*******************static variables initiate***************
//molecule profiles
QMap<long int, double> AtmosLayer::m_moleNumber;
QMap<long int, double> AtmosLayer::m_moleDensity;

//caculating direction, downward or upward
bool AtmosLayer::m_currentDir(DOWN);
double AtmosLayer::m_wl = 0.555;

QString AtmosLayer::m_resultPath;

double AtmosLayer::m_solidAngle[N_PI/2];

QList<double> AtmosLayer::m_zenithUpList;
QList<double> AtmosLayer::m_zenithDList;
QList<double> AtmosLayer::m_aziList;

double (*AtmosLayer::m_scatAnglesSameDir)[N_ZENITH][2*N_PI];
double (*AtmosLayer::m_scatAnglesDiffDir)[N_ZENITH][2*N_PI];

AtmosLayer::AtmosLayer(QString layerName, double hBottom, double hTop,
		       QObject *parent) :
    QObject(parent),
    m_layerName(layerName),
    m_loopUpTime(0),
    m_loopDownTime(0),
    m_hBottom(hBottom),
    m_hTop(hTop),

    m_solarIntensity(0),
    m_solarZen(0),
    m_solarAzi(0),
    m_solarOut(0),

    m_downIrradiance(0),
    m_solarIrradiance(0),
    m_currentIrradiance(0),
    m_saveMode(SAVE_DISABLE)

{
	layerInit();
}

AtmosLayer::~AtmosLayer()
{
	delete []m_lightInUp;
	delete []m_lightInD;
	delete []m_lightScatUp;
	delete []m_lightScatD;
	delete []m_lightScatUpTotal;
	delete []m_lightScatDTotal;
}

